package com.lcq.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.lcq.common.valid.SaveGroup;
import com.lcq.common.valid.UpdateGroup;
import com.lcq.common.valid.ValidShowStatus;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author lichuanqi
 * @email lichuanqi0086@163.com
 * @date 2021-02-25 19:28:13
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@NotNull(message = "修改信息品牌id不能为空",groups = {UpdateGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空",groups = {SaveGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotBlank(message = "品牌logo地址不能为空",groups = {SaveGroup.class})
	@URL(message = "品牌logo地址不合法",groups = {SaveGroup.class,UpdateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(message = "显示状态不能为空",groups = {SaveGroup.class})
	@ValidShowStatus(value = {0,1},groups = {SaveGroup.class,UpdateGroup.class},message = "显示状态取值只能是0或1")
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotNull(message = "检索首字母不能为空",groups = {SaveGroup.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是一个英文字母",groups = {SaveGroup.class,UpdateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "排序不能为空",groups = {SaveGroup.class})
	@Min(value = 0,message = "排序必须大于0",groups = {SaveGroup.class,UpdateGroup.class})
	private Integer sort;

}
